//
//  Config.h
//  NewRetail
//
//  Created by yuqin on 2019/6/18.
//  Copyright © 2019 yuqin. All rights reserved.
//

#ifndef Config_h
#define Config_h

#define UIScreenWidth CGRectGetWidth([[UIScreen mainScreen] bounds])
#define PERCENTW_ADAPTATION  UIScreenWidth/414.0f
#define FIT(f)  f*PERCENTW_ADAPTATION
#define FIT2(f)  (f/2)*PERCENTW_ADAPTATION
#define FIT3(f)  (f/3)*PERCENTW_ADAPTATION

#define isStringNull(x)       (!x || [x isKindOfClass:[NSNull class]]||x.length == 0||x == nil)
#define isEmptyString(x)      (isStringNull(x) || [x isEqual:@""] || [x isEqual:@"(null)"] || [x isEqual:@"[null]"] || [x isEqual:@"null"] || [x isEqual:@"<null>"])
#define isEmptyObject(object)  [NSObject isNullOrNilWithObject:object]


#define Rect(x, y, w, h)                    CGRectMake(x, y, w, h)


//设备版本号
#define DeviceValue [[[UIDevice currentDevice] systemVersion] floatValue]

#define YQ_PUSH(vc) [self.navigationController pushViewController:vc animated:YES]

#define weakify(var) \
try {} @catch (...) {} \
__weak __typeof__(var) var ## _weak = var

#define strongify(var) \
try {} @catch (...) {} \
__strong __typeof__(var) var = var ## _weak

#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
//#define DLog(...)
#endif

#endif /* Config_h */
